import React, { Component } from "react";
import style from "./styles.less";
import {BorderBox10} from '@jiaminghi/data-view-react'

class Index extends Component {
   
  render() {
    const { todayWarning } = this.props;
    let alldigits = todayWarning.todayWarningTotal !== 0 && todayWarning.length!==0 ? parseInt( todayWarning.todayWarningTotal % 100000 / 10000) : 0
    //千位数
    let thousands = todayWarning.todayWarningTotal !== 0 && todayWarning.length!==0 ?parseInt( todayWarning.todayWarningTotal % 100000 % 10000 / 1000):0
    //百位数
    let theHundreds =todayWarning.todayWarningTotal !== 0 && todayWarning.length!==0 ? parseInt(todayWarning.todayWarningTotal % 100000 % 10000 % 1000 / 100):0
    //十位数
    let tensdigit = todayWarning.todayWarningTotal !== 0 && todayWarning.length!==0 ?parseInt(todayWarning.todayWarningTotal % 100000 % 10000 % 1000 % 100 / 10):0
    //个位数
    let unitsdigit =todayWarning.todayWarningTotal !== 0 && todayWarning.length!==0 ? parseInt( todayWarning.todayWarningTotal % 100000 % 10000 % 1000 % 100 % 10 / 1):0
    

    return (
        <div className={style.div_body}>
            <BorderBox10>
                <div className={style.div_body_top}>
                <div className={style.div_body_right1}>
                    <div className={style.div_body_right2}>{alldigits}</div>
                </div>
                <div className={style.div_body_right1}>
                    <div className={style.div_body_right2}>{thousands}</div>
                </div>
                <div className={style.div_body_right1}>
                    <div className={style.div_body_right2}>{theHundreds}</div>
                </div>
                <div className={style.div_body_right1}>
                    <div className={style.div_body_right2}>{tensdigit}</div>
                </div>
                <div className={style.div_body_right1}>
                    <div className={style.div_body_right2}>{unitsdigit}</div>
                </div>
            </div>
            </BorderBox10> 
      </div>
    );
  }
}

export default Index;

        

